import request from '@/utils/request';

export function login(query) {//登录
  return request({
    url: '/user/login',
    method: 'post',
    data: query
  });
};
export function logout(query) {//登出
  return request({
    url: '/user/logout',
    method: 'get',
    params: query
  });
};
export function querys(query) {//获取用户列表数据
  return request({
    url: '/user/query',
    method: 'get',
    params: query
  });
};

export function register_edit(item,query) {//注册||编辑用户
  var url = (item==1)?'/user/editUser':'/user/register';
  return request({
    url: url,
    method: 'post',
    data: query
  });
};

export function deletes(query){//删除用户
  return request({
    url: '/user/delete',
    method: 'get',
    params: query
  });
};

export function check(query){//验证旧密码
  return request({
    url: '/user/check',
    method: 'get',
    params: query
  });
};
